export default {
  data () {
    return {

    }
  },
  methods: {
    // 设置表头
    getTableColumns (arr) {
      const tableColumns = {
        selection: {
          type: 'selection',
          width: 60,
          align: 'center',
          fixed: 'left'
        },
        employeeName: {
          title: '姓名',
          minWidth: 100,
          align: 'center',
          key: 'employeeName'
        },
        idCardTypeName: {
          title: '证件类型',
          minWidth: 140,
          align: 'center',
          key: 'idCardTypeName'
        },
        idCardNo: {
          title: '身份证号码',
          minWidth: 190,
          align: 'center',
          key: 'idCardNo'
        },
        categoryName_mx: {
          title: '类型',
          minWidth: 120,
          align: 'center',
          key: 'categoryName'
        },
        categoryName_zz: {
          title: '类型',
          minWidth: 120,
          align: 'center',
          key: 'insuranceName'
        },
        insureNo: {
          title: '参保编号',
          minWidth: 120,
          align: 'center',
          key: 'insureNo'
        },
        insuranceName: {
          title: '险种',
          minWidth: 120,
          align: 'center',
          key: 'insuranceName'
        },
        year: {
          title: '年',
          minWidth: 80,
          align: 'center',
          key: 'year'
        },
        month: {
          title: '月',
          minWidth: 80,
          align: 'center',
          key: 'month'
        },
        isPersonalBurden: {
          title: '单位/个人',
          minWidth: 100,
          align: 'center',
          key: 'isPersonalBurden',
          render: (h, params) => {
            let row = params.row
            let text = ''
            if (row.isPersonalBurden) {
              text = '个人'
            } else {
              text = '单位'
            }
            return h('span', text)
          }
        },
        baseAmt: {
          title: '基数(元)',
          minWidth: 100,
          align: 'center',
          key: 'baseAmt'
        },
        rate: {
          title: '比例(%)',
          minWidth: 100,
          align: 'center',
          key: 'rate'
        },
        amt: {
          title: '金额(元)',
          minWidth: 100,
          align: 'center',
          key: 'amt'
        },
        action: {
          title: '操作',
          minWidth: 100,
          align: 'center',
          slot: 'action'
        }
      }
      let data = []

      arr.forEach(col => data.push(tableColumns[col]))

      return data
    }
  }
}